<template>
	<div class="top">
		<p>详情</p>
		<span @click="back">返回</span>
	</div>
	<el-form
		ref="formDataRef"
	    style="max-width: 700px"
	    :model="formData"
	>
		<div class="one">
			<el-form-item label="请假人:" label-width="80">
				<el-input v-model.number="formData.userName" disabled />
			</el-form-item>
			<el-form-item label="班主任:" label-width="80">
				<el-input disabled value="暂无"></el-input>
			</el-form-item>
		</div>
		<div class="one">
			<el-form-item label="请假类型:" label-width="80">
				<el-input disabled v-model="formData.typeName" />
			</el-form-item>
			<el-form-item label="班级:" label-width="80">
				<el-input disabled value="暂无"></el-input>
			</el-form-item>
		</div>
		<div class="one">
			<el-form-item label="请假时间:" label-width="80">
				<el-input disabled :value="formData.startTime+'-'+formData.endTime" />
			</el-form-item>
			<el-form-item label="审批人:">
				<el-input disabled  v-model="formData.adminName"></el-input>
			</el-form-item>
		</div>
		<div class="one">
			<el-form-item label="审批状态:" label-width="80">
				
				<el-input v-if="formData.status==0" value="待审批" disabled></el-input>
				<el-input v-if="formData.status==1"  value="审批通过" disabled></el-input>
				<el-input v-if="formData.status==2" value="审批未通过" disabled></el-input>
				
			</el-form-item>
			<el-form-item label="请假天数:">
				<el-input disabled :value="formData.num+'天'"></el-input>
			</el-form-item>
		</div>
		<div style="display: flex;justify-content: space-between;">
			<div>
				<el-form-item label="申请时间:" label-width="80">
					<el-input disabled v-model="formData.createTime" />
				</el-form-item>
			</div>
			<div>
				<el-form-item label="请假原因:" label-width="80">
					<el-input disabled v-model="formData.content" style="height: 60px;text-align: center;"></el-input>
				</el-form-item>
			</div>
		</div>
		
	</el-form>
	
	
	
</template>

<script setup lang="ts">
	import {detailleave} from "@/api/wrd";
	import { reactive,onMounted } from 'vue';
	type emitType={
		(e:'back'):void;
	}	
	const emits=defineEmits<emitType>()
	const back=()=>{
		console.log(1111);
		emits("back")
	}
	let formData=reactive<any>({})
	const detailleaveFn=async()=>{
		let res=await detailleave({
			loaId:sessionStorage.getItem('loaId')
		})
		Object.assign(formData,res)
		console.log("申请详情",res)
		sessionStorage.removeItem("loaId")
	}
	onMounted(()=>{
		detailleaveFn()
	})
</script>

<style scoped lang="less">
	.top{
	        display: flex;
	        justify-content: space-between;
	        align-items: center;
	        p{
	            font-size: 21px;
	            font-weight: 600;
	        }
	        span{
	            font-size: 17px;
	        }
	    }
	.el-form{
		margin-top: 20px;
	}
	.one{
		// width: 60%;
		// height:80px;
		display: flex;
		// align-items: center;
		justify-content: space-between;
	}
	.el-input{
		width: 205px;
		margin-right: 10px;
		border: none;
	}
</style>